// ==UserScript==
// @name        plusphotos
// @namespace   Extracter
// @description Get plus' photos of a bussiness
// @include     https://plus.google.com/*/photos*
// @require		http://code.jquery.com/jquery-1.9.1.min.js
// @version     1
// ==/UserScript==
//var $ = unsafeWindow.jQuery;
//$(document).ready(function() {
	setTimeout(getImages,6000);
	/*
	function gup(name){
		name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");  
		var regexS = "[\\?&]"+name+"=([^&#]*)";  
		var regex = new RegExp( regexS );  
		var results = regex.exec(window.location.href); 
		 if( results == null )    return "";  
		else    return results[1];
	}
	*/
	function getImages() {
		//alert($("img.tDMXke").length);
		//var plusid = $(location).attr('href')+"";
		
		var plusid =window.location+"";
		var pl = plusid.split('/');
		plusid = pl[3];
		//alert(plusid);
		var src="";
		var i = 1;
		var img=new Array("","","","","","","");
		$("img.tDMXke").each(function(){
			img[i]= $(this).attr('src');
			i++;
			if (i>5) return false;
		});
		
		if (i>1) {
			$.post("http://www.cfdtradingnews.info/gplus.php",{id:plusid,i1:img[1],i2:img[2],i3:img[3],i4:img[4],i5:img[5]});
			//alert(img[1]);
		}
		setTimeout(close,1000);
	}
//});